Changing the values of variables: writing values to PLC

How to change a value of a →variable in Values of Variables view in order to write it to the →PLC:

  1. If the variable is included within a collapsed level, expand this collapsed level.
    To speed the expanding up: Filter the view. The levels with found matches are automatically expanded.

  2. Double-click a value (double-click the column Value) for a variable in the view. Alternative: Select the variable and press the Enter-Key.
    Result: A dialog is opened to change the value.
    Here the dialog for the INT variable count:


    Here the dialog for the STRING variable MyName (containing several lines):

  3. In the dialog, enter or select the new value and click  or press the Enter-Key.
    For STRING variables, the following is additionally valid: You are able to enter special characters, such as umlauts, by using the keyboard only in the tab Visual but not in the tab Text. For CHAR variables and in the tab Text for STRING variables, you must enter the appropriate three-character combination of the dollar sign ($) followed by two hexadecimal digits (see the glossary term "→character string literals" for some examples). If the value for the variable may consist of several lines, the following is valid for the tab Visual: A text with several lines is possible – press Shift+Enter.
    Result: The new value is written to the PLC. The Values of Variables view displays the new value.

No Forcing

Observe that the processed application may overwrite your value at any time because this change of the value is no forcing. See "Forcing the values of variables", if you want to force a variable.

Good to know
As alternative, it is also possible to change the values within the ST-viewer. See "Monitoring and changing values in viewer or editor" for this possibility.